﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace OplugAbpProject.Transaction
{
    public class Attachments : Entity<long>, IHasCreationTime, ICreationAudited, IMayHaveTenant, IHasModificationTime
    {
        [MaxLength(50)]
        public string SysRowID { get; set; } = Guid.NewGuid().ToString();
        public DateTime CreationTime { get; set; } = DateTime.Now;
        public long? CreatorUserId { get; set; }
        public int? TenantId { get; set; }
        public DateTime? LastModificationTime { get; set; }
        [Required]
        [MaxLength(50)]
        public string FileName { get; set; }
        /// <summary>
        /// 文件二进制字节流
        /// </summary>
        public byte[] FileData { get; set; }
        /// <summary>
        /// 文件扩展名
        /// </summary>
        [Required]
        [MaxLength(10)]
        public string FileExtension { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        public decimal FileSize { get; set; }
        /// <summary>
        /// 对象名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ObjectName { get; set; }
        /// <summary>
        /// 对象ID
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ObjectId { get; set; }        
    }
}
